<template>
    <div>
        测试页
        <demo ref="table" msg="Vite + Vue" :title="123" :count="2" :is-active="true" />

    </div>
</template>
<script setup lang="ts">
// import demo1 from './components/demo1.vue'
import type Demo1 from '@/components/demo1.vue';
import {
    ref,
    reactive,
    getCurrentInstance,
    onMounted,
} from 'vue';



const {
    proxy
} = getCurrentInstance()

const table = ref<InstanceType<typeof Demo1>>()
// const table=ref<InstanceType<typeof Demo1>()

onMounted(() => {
    table.value.change(1)
    // logMessage(1);

})
</script>
<!-- <script lang="ts">
import demo from './components/demo1.vue'

export default {
    components: {
        demo: demo
    },

    data() {
        return {
            internalCount: 0
        };
    },
    computed: {
        // 类型安全的 table ref
        tableRef(): InstanceType<typeof demo> | null {
            return this.$refs.table as InstanceType<typeof demo> || null
        }
    },
    mounted() {
        this.$refs.table.change(1)
       
    },
    methods: {
        chan() {
            // this.search = 1
        },

    }

}

</script> -->